{extend name="admin/b2c/base" /}
{block name="resources"/}
<link rel="stylesheet" type="text/css" href="ADMIN_CSS/defau.css">
<script src="ADMIN_JS/art_dialog.source.js"></script>
<script src="ADMIN_JS/iframe_tools.source.js"></script>
<script src="ADMIN_JS/material_managedialog.js"></script>
{/block}
{block name="main"}
<div class="set-style">
	<dl>
		<dt>网站标题:</dt>
		<dd>
			<input id="title" type="text" value="{$website.title}" />
		</dd>
	</dl>
	<dl>
		<dt>官方网址:</dt>
		<dd>
			<input id="web_url" type="text" value="{$website.web_url}" />
		</dd>
	</dl>
	<dl>
		<dt>联系地址:</dt>
		<dd>
			<input id="web_address" type="text" value="{$website.web_address}" />
		</dd>
	</dl>
	<dl>
		<dt>网站二维码:</dt>
		<dd>
			<p>
				<img src="__ROOT__/{$qrcode_path}">
			</p>
			<!-- <p><img src="{$website.web_qrcode}" title=""></p> -->
		</dd>
	</dl>
	<dl>
		<dt>网站描述:</dt>
		<dd>
			<textarea name="store_zy" rows="2" id="web_desc"
				class="textarea w400" maxlength="50">{$website.web_desc}</textarea>
			<p class="hint">关键字最多可输入50字，请用","进行分隔，例如”男装,女装,童装”</p>
		</dd>
	</dl>
	<dl>
		<dt>网站logo:</dt>
		<dd>
			<div class="class-logo">
				<p>
					<img id="imglogo" src="__ROOT__/{$website.logo}">
				</p>
			</div>
			<div class="ncsc-upload-btn">
				<a href="javascript:void(0);">
					<span>
						<input hidefocus="true" size="1" class="input-file" name="file_upload" id="uploadImg" type="file" onchange="imgUpload(this,'logo');">
						<input type="hidden" id="logo" value="{$website.logo}" />
					</span>
					<p><i class="fa fa-cloud-upload text"></i>上传图片</p>
				</a>
			</div>
			<p class="hint">
				<br><span style="color: orange;">建议使用宽100像素-高100像素内的GIF或PNG透明图片；点击下方"提交"按钮后生效。</span>
			</p>
		</dd>
	</dl>
	<dl>
		<dt>网站公众号二维码:</dt>
		<dd>
			<div class="class-logo">
				<p>
					<img id="imgweb_qrcode" src="__ROOT__/{$website.web_qrcode}">
				</p>
			</div>
			<div class="ncsc-upload-btn">
				<a href="javascript:void(0);">
					<span>
						<input hidefocus="true" size="1" class="input-file" name="file_upload" id="uploadImgweb_qrcode" type="file" onchange="imgUpload(this,'web_qrcode');">
						<input type="hidden" id="web_qrcode" value="{$website.web_qrcode}" />
					</span>
					<p><i class="fa fa-cloud-upload text"></i>上传图片</p>
				</a>
			</div>
			<p class="hint">
				<br><span style="color: orange;">建议使用宽100像素-高100像素内的GIF或PNG透明图片；点击下方"提交"按钮后生效。</span>
			</p>
		</dd>
	</dl>
	<dl>
		<dt>网站关键字:</dt>
		<dd>
			<p>
				<input id="key_words" type="text" value="{$website.key_words}" />
			</p>
			<p class="hint">用于网站搜索引擎的优化，关键字之间请用英文逗号分隔</p>
		</dd>
	</dl>
	<dl>
		<dt>网站联系方式:</dt>
		<dd>
			<p>
				<input id="web_phone" type="text" value="{$website.web_phone}" />
			</p>
		</dd>
	</dl>
	<dl>
		<dt>网站邮箱:</dt>
		<dd>
			<p>
				<input id="web_email" type="text" value="{$website.web_email}" />
			</p>
		</dd>
	</dl>
	<dl>
		<dt>网站QQ号:</dt>
		<dd>
			<p>
				<input id="web_qq" type="text" value="{$website.web_qq}" />
			</p>
		</dd>
	</dl>
	<dl>
		<dt>网站微信号:</dt>
		<dd>
			<p>
				<input id="web_weixin" type="text" value="{$website.web_weixin}" />
			</p>
		</dd>
	</dl>
	<dl>
		<dt>网站备案号:</dt>
		<dd>
			<p>
				<input id="web_icp" type="text" value="{$website.web_icp}" />
			</p>
		</dd>
	</dl>
	<dl>
		<dt>网站风格:</dt>
		<dd>
			<p>
				<select id="style_id"> {volist name="style_list" id="v"}
					<option value="{$v['style_id']}" {if
						condition="$website['style_id'] eq $v['style_id']"} selected{/if}>{$v['style_name']}</option>
					{/volist}
				</select>
			</p>
		</dd>
	</dl>
	<button class="edit_button" onclick="setConfigAjax();">提交</button>
</div>
<script src="ADMIN_JS/ajax_file_upload.js" type="text/javascript"></script>
<script src="__STATIC__/js/file_upload.js" type="text/javascript"></script>
{include file="admin/b2c/openDialog" /}
<script>
	/**
	 *图片上传
	 */
	function imgUpload(event, obj) {
		var fileid = $(event).attr("id");
		fileCommonUpload("UPLOAD_URL", fileid, "__UPLOAD__", obj);
	}
	function setConfigAjax() {
		var title = $("#title").val();
		var web_url = $("#web_url").val();
		var web_address = $("#web_address").val();
		var web_desc = $("#web_desc").val();
		var Logo = $("#logo").val();
		var web_qrcode = $("#web_qrcode").val();
		var key_words = $("#key_words").val();
		var web_phone = $("#web_phone").val();
		var web_email = $("#web_email").val();
		var web_qq = $("#web_qq").val();
		var web_weixin = $("#web_weixin").val();
		var web_icp = $("#web_icp").val();
		var web_style = $("#style_id").val();
		$.ajax({
			type : "post",
			url : "ADMIN_MAIN/Config/webConfig",
			data : {
				'title' : title,
				'web_url' : web_url,
				'web_address' : web_address,
				'web_desc' : web_desc,
				'logo' : Logo,
				'web_qrcode' : web_qrcode,
				'key_words' : key_words,
				'web_phone' : web_phone,
				'web_email' : web_email,
				'web_qq' : web_qq,
				'web_weixin' : web_weixin,
				'web_icp' : web_icp,
				'web_style' : web_style
			},
			success : function(data) {
				if (data["code"] > 0) {
					showMessage('success', data["message"],"ADMIN_MAIN/config/webconfig");
				} else {
					showMessage('error', data["message"]);
				}
			}
		});
	}
</script>
{/block}